package com.tax.model;

/**
 * Created by Administrator on 2019/01/05 0005.
 */
public class ResponseData {
    public static final String DEFAULT_SUCCESS_MESSAGE = "请求成功";
    public static final String DEFAULT_ERROR_MESSAGE = "网络异常";
    public static final Integer DEFAULT_SUCCESS_CODE = Integer.valueOf(200);
    public static final Integer DEFAULT_ERROR_CODE = Integer.valueOf(500);
    private Boolean success;
    private Integer code;
    private String message;
    private Object data;

    public ResponseData() {
    }

    public ResponseData(Boolean success, Integer code, String message, Object data) {
        this.success = success;
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static SuccessResponseData success() {
        return new SuccessResponseData();
    }

    public static SuccessResponseData success(Object object) {
        return new SuccessResponseData(object);
    }

    public static SuccessResponseData success(Integer code, String message, Object object) {
        return new SuccessResponseData(code, message, object);
    }

    public static ErrorResponseData error(String message) {
        return new ErrorResponseData(message);
    }

    public static ErrorResponseData error(Integer code, String message) {
        return new ErrorResponseData(code, message);
    }

    public static ErrorResponseData error(Integer code, String message, Object object) {
        return new ErrorResponseData(code, message, object);
    }

    public Boolean getSuccess() {
        return this.success;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    public Object getData() {
        return this.data;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public boolean equals(Object o) {
        if(o == this) {
            return true;
        } else if(!(o instanceof ResponseData)) {
            return false;
        } else {
            ResponseData other = (ResponseData)o;
            if(!other.canEqual(this)) {
                return false;
            } else {
                label59: {
                    Boolean this$success = this.getSuccess();
                    Boolean other$success = other.getSuccess();
                    if(this$success == null) {
                        if(other$success == null) {
                            break label59;
                        }
                    } else if(this$success.equals(other$success)) {
                        break label59;
                    }

                    return false;
                }

                Integer this$code = this.getCode();
                Integer other$code = other.getCode();
                if(this$code == null) {
                    if(other$code != null) {
                        return false;
                    }
                } else if(!this$code.equals(other$code)) {
                    return false;
                }

                String this$message = this.getMessage();
                String other$message = other.getMessage();
                if(this$message == null) {
                    if(other$message != null) {
                        return false;
                    }
                } else if(!this$message.equals(other$message)) {
                    return false;
                }

                Object this$data = this.getData();
                Object other$data = other.getData();
                if(this$data == null) {
                    if(other$data != null) {
                        return false;
                    }
                } else if(!this$data.equals(other$data)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof ResponseData;
    }

    public int hashCode() {
        boolean PRIME = true;
        byte result = 1;
        Boolean $success = this.getSuccess();
        int result1 = result * 59 + ($success == null?43:$success.hashCode());
        Integer $code = this.getCode();
        result1 = result1 * 59 + ($code == null?43:$code.hashCode());
        String $message = this.getMessage();
        result1 = result1 * 59 + ($message == null?43:$message.hashCode());
        Object $data = this.getData();
        result1 = result1 * 59 + ($data == null?43:$data.hashCode());
        return result1;
    }

    public String toString() {
        return "ResponseData(success=" + this.getSuccess() + ", code=" + this.getCode() + ", message=" + this.getMessage() + ", data=" + this.getData() + ")";
    }
}
